<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<%@ include file = "lianjie.jsp" %>

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>

	
		 <%
		 	String user_id = request.getParameter("student_id");
		 	
		 
				String ID = ""; //
				String modify_username = ""; //
				String password = ""; //
				String kind = ""; //
				String sex = ""; //
				String tel = ""; //
				int num = 0;
				String sql = "select * from usermassage where ID = '" + user_id + "' and kind = '0'";
				ResultSet rs2 = stmt.executeQuery(sql);
				if(!rs2.next()){
					out.print("该学生不存在");
					response.setHeader("Refresh", "2;URL=modify_student.jsp");
				}else{
					ID = rs2.getString("ID");
					modify_username = rs2.getString("username");
					password = rs2.getString("password");
					kind = rs2.getString("kind");
					sex = rs2.getString("sex");
					tel = rs2.getString("tel");
				}
				session.setAttribute("ID", ID);
			%>
<form name = "fm1" id="fm1">
	<table   border="1" cellspacing="0" cellpadding="3" align = "center">
			<tr>
				<td width="20%">ID</td>
				<td>
					<input type = "text" name = "id" id = "id" value = "<%=ID%>" disabled>
				</td>
			</tr>
			<tr>
				<td width="20%">username</td>
				<td>
				<input type = "text" name = "username" id = "username" value = "<%=modify_username%>">
				</td>
			</tr>
			<tr>
				<td width="20%">password</td>
				<td>
				<input type = "text" name = "password" id = "password" value = "<%=password%>">
				</td>
			</tr>
			<tr>
				<td width="20%">kind</td>
				<td>
				<input type = "text" name = "kind" id = "kind" value = "<%=kind%>" disabled>
				</td>
			</tr>
			<tr>
				<td width="20%">sex</td>
				<td>
					<input type = "text" name = "sex" id = "sex" value = "<%=sex%>">
				</td>
			</tr>
			<tr>
				<td width="20%">tel</td>
				<td>
					<input type = "text" name = "tel" id = "tel" value = "<%=tel%>">
				</td>
			</tr>
		</table>
		<br><br>
			<div align = "center" >
				<input type = "submit" name = "submit"  value = "保存" onClick = "submitModify()" style = "font-size:30px;">
				<input type = "button" name = "back1"  value = "返回" onClick = "back_last()" style = "font-size:30px;">
			</div>
			
</form>
</body>
</html>


<script>
	function submitModify(){
		
		document.fm1.method = "post";
		document.fm1.action = "modify_do_submit.jsp";
		//document.fm1.submit();
	} 
	/* function back_last(){
		document.fm.method = "post";
		document.fm.action = "modify_do.jsp";
		document.fm.submit();
	}  */
	/* function modify_submit(){
		window.location.href = "modify_do_submit.jsp";
	}
	function back_last(){
		window.location.href = "modify_student.jsp";
	}  */
	
</script>

